home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1994 March / Internet Info CD-ROM (Walnut Creek) (March 1994).iso / security / log_tcp_6.0alpha.shar / inet_addr_fix < prev    next >
Encoding:
Text File  |  1993-07-02  |  553 b   |  22 lines

  1. #ifndef lint
  2. static char xsccsid[] = "@(#) inet_addr_fix 1.2 93/07/02 16:33:46";
  3. #endif
  4.  
  5.  /*
  6.   * Some inet_addr() versions return a struct/union instead of a long. You
  7.   * have this problem when the compiler complains about illegal lvalues or
  8.   * something like that. The following code fixes this mutant behaviour.
  9.   * 
  10.   * Bug reported by ben@piglet.cr.usgs.gov (Rev. Ben A. Mesander).
  11.   */
  12.  
  13. static long fix_inet_addr(string)
  14. char   *string;
  15. {
  16.     struct in_addr addr = inet_addr(string);
  17.  
  18.     return (addr.s_addr);
  19. }
  20.  
  21. #define inet_addr fix_inet_addr
  22.